-- ----------------------------------------------------------
--
-- Author: czf
-- date: 2018-12-14
-- description: 责任链模式-记录器(抽象类)
--
-- ----------------------------------------------------------

AbstractLogger = AbstractLogger or BaseClass()

function AbstractLogger:__init()
	self.nextLogger = nil
	self.level = nil
end

function AbstractLogger:SetNextLogger(nextLogger)
	self.nextLogger = nextLogger
end

function AbstractLogger:LogMessage(level, message)
	if self.level and self.level <= level then
		self:Write(message)
	end

	if self.nextLogger then
		self.nextLogger:LogMessage(level, message)
	end
end

function AbstractLogger:Write(message)
	-- body
end